home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 June / SGI Freeware 1998 June.iso / dist / fw_bind.idb / usr / freeware / catman / u_man / cat1 / dig.1.z / dig.1
Text File  |  1998-05-26  |  18KB  |  296 lines

  1. DIG(1)                       BSD Reference Manual                       DIG(1)
  2.  
  3. NNAAMMEE
  4.      ddiigg - send domain name query packets to name servers
  5.  
  6. SSYYNNOOPPSSIISS
  7.      ddiigg [@@_s_e_r_v_e_r] _d_o_m_a_i_n [<_q_u_e_r_y_-_t_y_p_e>] [<_q_u_e_r_y_-_c_l_a_s_s>] [++<_q_u_e_r_y_-_o_p_t_i_o_n>]
  8.          [--<_d_i_g_-_o_p_t_i_o_n>] [_%_c_o_m_m_e_n_t]
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      DDiigg (domain information groper) is a flexible command line tool which can
  12.      be used to gather information from the Domain Name System servers.  DDiigg
  13.      has two modes: simple interactive mode for a single query, and batch mode
  14.      which executes a query for each in a list of several query lines. All
  15.      query options are accessible from the command line.
  16.  
  17.      The usual simple use of ddiigg will take the form:
  18.  
  19.                  ddiigg @@_s_e_r_v_e_r _d_o_m_a_i_n _q_u_e_r_y_-_t_y_p_e _q_u_e_r_y_-_c_l_a_s_s
  20.  
  21.      where:
  22.  
  23.      _s_e_r_v_e_r      may be either a domain name or a dot-notation Internet ad-
  24.                  dress. If this optional field is omitted, ddiigg will attempt to
  25.                  use the default name server for your machine.
  26.  
  27.                  _N_o_t_e_: If a domain name is specified, this will be resolved
  28.                  using the domain name system resolver (i.e., BIND). If your
  29.                  system does not support DNS, you may _h_a_v_e to specify a dot-
  30.                  notation address.  Alternatively, if there is a server at
  31.                  your disposal somewhere,  all that is required is that
  32.                  _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f be present and indicate where the default
  33.                  name servers reside,  so that _s_e_r_v_e_r itself can be resolved.
  34.                  See resolver(5) for information on _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f. WWAARRNNIINNGG::
  35.                  Changing _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f will affect both the standard re-
  36.                  solver library and (potentially) several programs which use
  37.                  it.  As an option, the user may set the environment variable
  38.                  LOCALRES to name a file which is to be used instead of
  39.                  _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f standard resolver (LOCALRESis specific to
  40.                  the ddiigg resolver and  is  not  referenced  by  the). If the
  41.                  LOCALRES variable is not set or the specified file is not
  42.                  readable, then _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f will be used.
  43.  
  44.      _d_o_m_a_i_n      is the domain name for which you are requesting information.
  45.                  See the --xx option (documented in the _O_T_H_E_R _O_P_T_I_O_N_S subsection
  46.                  of this section) for convenient way to specify inverse ad-
  47.                  dress query.
  48.  
  49.      _q_u_e_r_y_-_t_y_p_e  is the type of information (DNS query type) that you are re-
  50.                  questing. If omitted, the default is ``_a'' (T_A = _a_d_d_r_e_s_s).
  51.                  The following types are recognized:
  52.  
  53.                  _a       T_A        network address
  54.                  _a_n_y     T_ANY      all/any information about specified domain
  55.                  _m_x      T_MX       mail exchanger for the domain
  56.                  _n_s      T_NS       name servers
  57.                  _s_o_a     T_SOA      zone of authority record
  58.                  _h_i_n_f_o   T_HINFO    host information
  59.                  _a_x_f_r    T_AXFR     zone transfer (must ask an authoritative
  60.                                     server)
  61.                  _t_x_t     T_TXT      arbitrary number of strings
  62.  
  63.                  (See RFC 1035 for the complete list.)
  64.  
  65.      _q_u_e_r_y_-_c_l_a_s_s
  66.                  is the network class requested in the query. If omitted, the
  67.                  default is ``_i_n'' (C_IN = _I_n_t_e_r_n_e_t). The following classes
  68.                  are recognized:
  69.  
  70.                  _i_n      C_IN       Internet class domain
  71.                  _a_n_y     C_ANY      all/any class information
  72.  
  73.                  (See RFC 1035 for the complete list.)
  74.  
  75.                  _N_o_t_e_: ``_A_n_y'' can be used to specify a _c_l_a_s_s and/or a _t_y_p_e of
  76.                  query.  DDiigg will parse the first occurrence of ``_a_n_y'' to
  77.                  mean _q_u_e_r_y_-_t_y_p_e _= T_ANY. To specify _q_u_e_r_y_-_c_l_a_s_s _= C_ANY, you
  78.                  must either specify ``any'' twice, or set _q_u_e_r_y_-_c_l_a_s_s using
  79.                  the --cc option (see below).
  80.  
  81.    OOTTHHEERR OOPPTTIIOONNSS
  82.  
  83.      %_i_g_n_o_r_e_d_-_c_o_m_m_e_n_t
  84.                  ``%'' is used to included an argument that is simply not
  85.                  parsed.  This may be useful  if running ddiigg in batch mode.
  86.                  Instead of resolving every _@_s_e_r_v_e_r_-_d_o_m_a_i_n_-_n_a_m_e in a list of
  87.                  queries, you can avoid the overhead of doing so, and still
  88.                  have the domain name on the command line as a reference. Ex-
  89.                  ample:
  90.  
  91.                              ddiigg @@112288..99..00..3322 %%vveenneerraa..iissii..eedduu mmxx iissii..eedduu
  92.  
  93.      --<_d_i_g _o_p_t_i_o_n>
  94.                  ``--'' is used to specify an option which affects the opera-
  95.                  tion of ddiigg. The following options are currently available
  96.                  (although not guaranteed to be useful):
  97.  
  98.                  --xx _d_o_t_-_n_o_t_a_t_i_o_n_-_a_d_d_r_e_s_s
  99.                              Convenient form to specify inverse address map-
  100.                              ping.  Instead of ``ddiigg 3322..00..99..112288..iinn--
  101.                              aaddddrr..aarrppaa'', one can simply ``ddiigg --xx
  102.                              112288..99..00..3322''.
  103.  
  104.                  --ff _f_i_l_e     File for ddiigg batch mode. The file contains a list
  105.                              of query specifications ( ddiigg command lines)
  106.                              which are to be executed successively.  Lines be-
  107.                              ginning with `;', `#', or `\n' are ignored.  Oth-
  108.                              er options may still appear on command line, and
  109.                              will be in effect for each batch query.
  110.  
  111.                  --TT _t_i_m_e     Time in seconds between start of successive
  112.                              queries when running in batch mode. Can be used
  113.                              to keep two or more batch ddiigg commands running
  114.                              roughly in sync.  Default is zero.
  115.  
  116.                  --pp _p_o_r_t     Port number. Query a name server listening to a
  117.                              non-standard port number.  Default is 53.
  118.  
  119.                  --PP[_p_i_n_g_-_s_t_r_i_n_g]
  120.                              After query returns, execute a ping(8) command
  121.                              for response time comparison.  This rather unele-
  122.                              gantly makes a call to the shell.  The last three
  123.                              lines of statistics is printed for the command:
  124.  
  125.                                          ppiinngg --ss --sseerrvveerr__nnaammee --5566 --33
  126.  
  127.                              If the optional ``_p_i_n_g___s_t_r_i_n_g'' is present, it
  128.                              replaces ``ppiinngg --ss'' in the shell command.
  129.  
  130.                  --tt _q_u_e_r_y_-_t_y_p_e
  131.                              Specify type of query.  May specify either an in-
  132.                              teger value to be included in the type field or
  133.                              use the abbreviated mnemonic as discussed above
  134.                              (i.e., _m_x _= T_MX).
  135.  
  136.                  --cc _q_u_e_r_y_-_c_l_a_s_s
  137.                              Specify class of query. May specify either an in-
  138.                              teger value to be included in the class field or
  139.                              use the abbreviated mnemonic as discussed above
  140.                              (i.e., in = C_IN).
  141.  
  142.                  --eennvvssaavv     This flag specifies that the ddiigg environment (de-
  143.                              faults, print options, etc.), after all of the
  144.                              arguments are parsed, should be saved to a file
  145.                              to become the default environment.  This is use-
  146.                              ful if you do not like the standard set of de-
  147.                              faults and do not desire to include a large num-
  148.                              ber of options each time ddiigg is used.  The envi-
  149.                              ronment consists of resolver state variable
  150.                              flags, timeout, and retries as well as the flags
  151.                              detailing ddiigg output (see below).  If the shell
  152.                              environment variable LOCALDEF is set to the name
  153.                              of a file, this is where the default ddiigg environ-
  154.                              ment is saved.  If not, the file ``_D_i_G_._e_n_v'' is
  155.                              created in the current working directory.
  156.  
  157.                              _N_o_t_e_: LOCALDEF is specific to the ddiigg resolver,
  158.                              and will not affect operation of the standard re-
  159.                              solver library.
  160.  
  161.                              Each time ddiigg is executed, it looks for
  162.                              ``_._/_D_i_G_._e_n_v'' or the file specified by the shell
  163.                              environment variable LOCALDEF. If such file ex-
  164.                              ists and is readable, then the environment is re-
  165.                              stored from this file before any arguments are
  166.                              parsed.
  167.  
  168.                  --eennvvsseett     This flag only affects batch query runs. When
  169.                              ``--eennvvsseett'' is specified on a line in a ddiigg batch
  170.                              file, the ddiigg environment after the arguments are
  171.                              parsed becomes the default environment for the
  172.                              duration of the batch file, or until the next
  173.                              line which specifies ``--eennvvsseett''.
  174.  
  175.                  --[nnoo] ssttiicckk
  176.                              This flag only affects batch query runs.  It
  177.                              specifies that the ddiigg environment (as read ini-
  178.                              tially or set by ``--eennvvsseett'' switch) is to be re-
  179.                              stored before each query (line) in a ddiigg batch
  180.                              file.  The default ``--nnoossttiicckk'' means that the
  181.                              ddiigg environment does not stick, hence options
  182.                              specified on a single line in a ddiigg batch file
  183.                              will remain in effect for subsequent lines (i.e.
  184.                              they are not restored to the ``sticky'' default).
  185.  
  186.      ++<_q_u_e_r_y_-_o_p_t_i_o_n>
  187.                  ``+'' is used to specify an option to be changed in the query
  188.                  packet or to change ddiigg output specifics. Many of these are
  189.                  the same parameters accepted by nslookup(8).  If an option
  190.                  requires a parameter, the form is as follows:
  191.  
  192.                              ++ _k_e_y_w_o_r_d [=_v_a_l_u_e]
  193.  
  194.                  Most keywords can be abbreviated.  Parsing of the ``+'' op-
  195.                  tions  is very  simplistic -- a value must not be separated
  196.                  from its keyword by white space. The following keywords are
  197.                  currently available:
  198.  
  199.                  Keyword      Abbrev.  Meaning [default]
  200.  
  201.                  [nnoo] ddeebbuugg     (ddeebb)    turn on/off debugging mode [ddeebb]
  202.                  [nnoo] dd22                 turn on/off extra debugging mode
  203.                                          [nnoodd22]
  204.                  [nnoo] rreeccuurrssee   (rreecc)    use/don't use recursive lookup [rreecc]
  205.                  rreettrryy==_#       (rreett)     set number of retries to # [4]
  206.                  ttiimmee==_#        (ttii)      set timeout length to # seconds [4]
  207.                  [nnoo] kkoo                 keep open option (implies vc) [nnookkoo]
  208.                  [nnoo] vvcc                 use/don't use virtual circuit [nnoovvcc]
  209.                  [nnoo] ddeeffnnaammee   (ddeeff)    use/don't use default domain name
  210.                                          [ddeeff]
  211.                  [nnoo] sseeaarrcchh    (sseeaa)    use/don't use domain search list
  212.                                          [sseeaa]
  213.                  ddoommaaiinn==_N_A_M_E   (ddoo)      set default domain name to _N_A_M_E
  214.                  [nnoo] iiggnnoorree    (ii)      ignore/don't ignore trunc. errors
  215.                                          [nnooii]
  216.                  [nnoo] pprriimmaarryy   (pprr)     use/don't use primary server [nnoopprr]
  217.                  [nnoo] aaaaoonnllyy    (aaaa)     authoritative query only flag [nnooaaaa]
  218.                  [nnoo] ccmmdd                echo parsed arguments [ccmmdd]
  219.                  [nnoo] ssttaattss     (sstt)     print query statistics [sstt]
  220.                  [nnoo] HHeeaaddeerr    (HH)      print basic header [HH]
  221.                  [nnoo] hheeaaddeerr    (hhee)     print header flags [hhee]
  222.                  [nnoo] ttttlliidd     (tttt)     print TTLs [tttt]
  223.                  [nnoo] ccll                 print class info [nnooccll]
  224.                  [nnoo] qqrr                 print outgoing query [nnooqqrr]
  225.                  [nnoo] rreeppllyy     (rreepp)    print reply [rreepp]
  226.                  [nnoo] qquueess      (qquu)     print question section [qquu]
  227.                  [nnoo] aannsswweerr    (aann)     print answer section [aann]
  228.                  [nnoo] aauutthhoorr    (aauu)     print authoritative section [aauu]
  229.                  [nnoo] aaddddiitt     (aadd)     print additional section [aadd]
  230.                  ppffddeeff                   set to default print flags
  231.                  ppffmmiinn                   set to minimal default print flags
  232.                  ppffsseett==_#                 set print flags to # (# can be
  233.                                          hex/octal/decimal)
  234.                  ppffaanndd==_#                 bitwise and print flags with #
  235.                  ppffoorr==_#                  bitwise or print flags with #
  236.  
  237.                  The rreettrryy and ttiimmee options affect the retransmission strategy
  238.                  used by the resolver library when sending datagram queries.
  239.                  The algorithm is as follows:
  240.  
  241.                        for i = 0 to retry - 1
  242.                            for j = 1 to num_servers
  243.                                send_query
  244.                                wait((time * (2**i)) / num_servers)
  245.                            end
  246.                        end
  247.  
  248.                  (Note: ddiigg always uses a value of 1 for ``num_servers''.)
  249.  
  250.    DDEETTAAIILLSS
  251.      DDiigg once required a slightly modified version of the BIND resolver(3) li-
  252.      brary.  As of BIND 4.9, BIND's resolver has been augmented to work prop-
  253.      erly with ddiigg. Essentially, ddiigg is a straight-forward (albeit not pretty)
  254.      effort of parsing arguments and setting appropriate parameters.  DDiigg uses
  255.      resolver(3) routines rreess__iinniitt(), rreess__mmkkqquueerryy(), rreess__sseenndd() as well as ac-
  256.      cessing the ___r_e_s structure.
  257.  
  258. EENNVVIIRROONNMMEENNTT
  259.      LOCALRES    file to use in place of Pa /etc/resolv.conf
  260.      LOCALDEF    default environment file
  261.  
  262.      See also the explanation of the --eennvvssaavv, --eennvvsseett, and --[nnoo] ssttiicckk op-
  263.      tions, above.
  264.  
  265. FFIILLEESS
  266.      /etc/resolv.conf
  267.                          initial domain name and name server addresses
  268.      ./DiG.env           default save file for default options
  269.  
  270. SSEEEE AALLSSOO
  271.      named(8),  resolver(3),  resolver(5),  nslookup(8).
  272.  
  273. SSTTAANNDDAARRDDSS
  274.      RFC 1035.
  275.  
  276. AAUUTTHHOORR
  277.      Steve Hotz hotz@isi.edu
  278.  
  279. AACCKKNNOOWWLLEEDDGGMMEENNTTSS
  280.      DDiigg uses functions from nslookup(8) authored by Andrew Cherenson.
  281.  
  282. BBUUGGSS
  283.      DDiigg has a serious case of "creeping featurism" -- the result of consider-
  284.      ing several potential uses during it's development.  It would probably
  285.      benefit from a rigorous diet.  Similarly, the print flags and granularity
  286.      of the items they specify make evident their rather ad hoc genesis.
  287.  
  288.      DDiigg does not consistently exit nicely (with appropriate status) when a
  289.      problem occurs somewhere in the resolver (NNOOTTEE::most of the common exit
  290.      cases are handled). This is particularly annoying when running in batch
  291.      mode.  If it exits abnormally (and is not caught), the entire batch
  292.      aborts; when such an event is trapped, ddiigg simply continues with the next
  293.      query.
  294.  
  295. 4th Berkeley Distribution       August 30, 1990                              5
  296.